This application claims priority from Japanese patent application 2005-287476, filed on Sep. 30, 2005. The entire content of the aforementioned application is incorporated herein by reference.
1. Field of the Invention
The present invention relates to an image processing apparatus that specifies a region having a previously registered color in an acquired image and more particularly, to an image processing apparatus that can easily extract a candidate color for a registration color from a model image.
2. Description of the Background Art
Automatization has been increased in a manufacturing field in view of laborsaving and promotion of high efficiency. In order to implement automatization, many sensors using light, electricity, electric wave, acoustic wave and the like are used. Among such sensors, an image sensor that can determine whether a product is defective or not or identify the product by taking the image of the product and processing the image is often used. According to the image sensor, since a detecting function similar to visual detection by a human can be implemented, its applied field is wide.
The image sensor comprises an imaging unit for taking the image of an object to be detected, and an image processing unit (referred to as an amplifying unit also) for processing the image taken from the imaging unit in general, in which it is determined whether a region having a predetermined configuration is contained in the image taken by the imaging unit or not.
According to a general-purpose image sensor especially, it is generally constituted such that the configuration of the object to be detected is determined based on a gray image that does not contain color information. However, as an information technology has been progressed recently, even in a general-purpose image sensor, the image sensor that can determine a color using an color image at the same time in addition to conventional determination of the configuration has been used in practice. Such determination of the color includes a process for specifying a region having a predetermined registered color in the acquired image.
According to the conventional configuration detection using the gray image, the configuration is determined based on a so-called gray image consisting of a plurality of pixels each having one-dimensional gradation value (256 gradation, for example). Meanwhile, each pixel constituting a color image is expressed by three-dimensional coordinates comprising a RGB value comprising respective proportions of red, green and blue based on three primary colors of light, or comprising values of a hue, value and chroma that are three attributes of color. Therefore, in order to set the registration color to specify the region, three parameters are needed. In addition, such parameter is called a color parameter also.
Therefore, an image processing apparatus that acquires a model image to extract the registration color and displays a color contained in the model image has been devised.
For example, Japanese Patent Application Laid-Open No. 2-194479 (patent document 1) discloses an image processing apparatus that can automatically extract a color parameter at a designated point (pixel).
Meanwhile, even in an image that appears in the same color from human eyes, a color parameter of each pixel is slightly different in many cases. This means that the image processing apparatus determines that the region consists of a plurality of different colors.
Thus, according to a general image processing apparatus that processes a color image, a process in which a threshold value width is given to a color parameter for the registration color and the pixel having the color contained within the range of the threshold value width is regarded as the registration color is performed. Conversely, the region cannot be specified for practical use unless an optimal color parameter range is set according to the degree of dispersion of the color parameter in the whole image.
However, according to the conventional image processing apparatus, although the color parameter at a specific point (pixel) can be acquired, an optimal color parameter range cannot be acquired from the obtained whole image. Therefore, it is necessary to determine the registration color through a trial and error process, according to various shooting condition such as lighting and reflection coefficient, so that the image processing apparatus cannot be satisfactorily operated without dependence on the intuition or experience of the person of skill in many cases.